package com.ewhale.feitengguest.widget;

import android.app.Dialog;
import android.content.Context;
import android.widget.TextView;

import com.ewhale.feitengguest.R;

import androidx.annotation.NonNull;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class VersionDialog extends Dialog {

    @BindView(R.id.tv_content)
    TextView mTvContent;

    public VersionDialog(@NonNull Context context, String content, int isForce) {
        super(context, com.simga.library.R.style.Dialog);
        if (isForce == 1) {
            this.setCanceledOnTouchOutside(false);
        } else {
            this.setCanceledOnTouchOutside(true);
        }
        setContentView(R.layout.dialog_version);
        ButterKnife.bind(this);
        mTvContent.setText(content);
    }

    @OnClick(R.id.btn_update)
    public void onViewClicked() {
        if (mListenter != null) {
            mListenter.onClick();
        }
        dismiss();
    }

    private onClickListenter mListenter;

    public void setListenter(onClickListenter listenter) {
        mListenter = listenter;
    }

    public interface onClickListenter {
        void onClick();
    }
}
